
import request from '@/utils/request'

// 查询指令配置列表
export function getOrderConfigTreeList() {
  return request({
    url: '/comlbs/orderConfiguration/tree',
    method: 'get'
  })
}

// 查询指令配置详细
export function getOrderConfiguration(id) {
  return request({
    url: '/comlbs/orderConfiguration/' + id,
    method: 'get'
  })
}

// 新增指令配置
export function addOrderConfiguration(data) {
  return request({
    url: '/comlbs/orderConfiguration',
    method: 'post',
    data: data
  })
}

// 修改指令配置
export function updateOrderConfiguration(data) {
  return request({
    url: '/comlbs/orderConfiguration',
    method: 'put',
    data: data
  })
}
// 指令下发设备树
export function getAlltreelist() {
  return request({
    url: '/system/dept/orderSendDeviceTree',
    method: 'get',
  })
}
// 指令发送组列表
export function getOrderRecordList(query) {
  return request({
    url: '/comlbs/orderSendRecord/group/list',
    method: 'get',
    params: {
      ...query
    }
  })
}
// 发送指令
export function saveOrder(data) {
  return request({
    url: '/comlbs/orderSendRecord/sendOrder',
    method: 'post',
    data: data
  })
}
// 新增指令发送记录
export function orderSend(data) {
  return request({
    url: '/comlbs/orderSendRecord',
    method: 'post',
    data: data
  })
}
// 指令发送详情列表
export function orderDetailList(query) {
  return request({
    url: '/comlbs/orderSendRecord/list',
    method: 'get',
    params: query
  })
}

// 删除指令配置
export function delOrderConfiguration(ids) {
  return request({
    url: '/comlbs/orderConfiguration/' + ids,
    method: 'delete'
  })
}
